'\" te
.\" Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DI_PROM_PROP_DATA 3DEVINFO "Dec 1, 1998"
.SH NAME
di_prom_prop_data, di_prom_prop_next, di_prom_prop_name \- access PROM device
information
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
#include <libdevinfo.h>

\fBdi_prom_prop_t\fR \fBdi_prom_prop_next\fR(\fBdi_prom_handle_t\fR \fIph\fR, \fBdi_node_t\fR \fInode\fR,
     \fBdi_prom_prop_t\fR \fIprom_prop\fR);
.fi

.LP
.nf
\fBchar *\fR\fBdi_prom_prop_name\fR(\fBdi_prom_prop_t\fR \fIprom_prop\fR);
.fi

.LP
.nf
\fBint\fR \fBdi_prom_prop_data\fR(\fBdi_prom_prop_t\fR \fIprom_prop\fR, \fBuchar_t **\fR\fIprop_data\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fInode\fR\fR
.ad
.RS 13n
Handle to a device node in the snapshot of kernel device tree.
.RE

.sp
.ne 2
.na
\fB\fIph\fR\fR
.ad
.RS 13n
\fBPROM\fR handle
.RE

.sp
.ne 2
.na
\fB\fIprom_prop\fR\fR
.ad
.RS 13n
Handle to a \fBPROM\fR property.
.RE

.sp
.ne 2
.na
\fB\fIprop_data\fR\fR
.ad
.RS 13n
Address of a pointer.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBdi_prom_prop_next()\fR function obtains a handle to the next property on
the \fBPROM\fR property list associated with \fInode\fR. If \fIprom_prop\fR is
\fBDI_PROM_PROP_NIL\fR, the first property associated with \fInode\fR is
returned.
.sp
.LP
The \fBdi_prom_prop_name()\fR function returns the name of the \fIprom_prop\fR
property.
.sp
.LP
The \fBdi_prom_prop_data()\fR function returns the value of the \fIprom_prop\fR
property. The return value is a non-negative integer specifying the size in
number of bytes in \fIprop_data\fR.
.sp
.LP
All memory allocated by these functions is managed by the library and must not
be freed by the caller.
.SH RETURN VALUES
.sp
.LP
The \fBdi_prom_prop_data()\fR function returns the number of bytes in
\fIprop_data\fR and \fIprop_data\fR is updated to point to a byte array
containing the property value. If  0 is returned, the property is a boolean
property and the existence of this property indicates the value is true.
.sp
.LP
The \fBdi_prom_prop_name()\fR function returns a pointer to a string that
contains the name of \fIprom_prop\fR.
.sp
.LP
The \fBdi_prom_prop_next()\fR function returns a handle to the next \fBPROM\fR
property. \fBDI_PROM_PROP_NIL\fR is returned if no additional properties exist.
.SH ERRORS
.sp
.LP
See \fBopenprom\fR(4D) for a description of possible errors.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR openprom (4D),
.BR attributes (7)
.sp
.LP
\fIWriting Device Drivers\fR
